/**
 * @file        application.hpp
 * @brief       Defines the GTD application barebones.
 *
 * @author      Emre Turkay <emreturkay at gmail>
 * @date        May.31.2008
 */

#ifndef _APPLICATION_HPP_
#define _APPLICATION_HPP_

#include "gtd.hpp"

#include <boost/optional.hpp>
#include <boost/bind.hpp>

#include <exception>
#include <vector>
#include <string>

// Forward declarations.
struct interface;

struct application
{
    application(interface& intf, gtd::gtd& backend);
    void run();
    void help(const std::vector<std::string>&);
    void next(const std::vector<std::string>&);
    void done(const std::vector<std::string>&);
    void cancel(const std::vector<std::string>&);
    void defer(const std::vector<std::string>&);
    void list(const std::vector<std::string>& args);
    void stat(const std::vector<std::string>&);
    void quit(const std::vector<std::string>&);
    void append(const std::vector<std::string>& args);
    void prepend(const std::vector<std::string>& args);
    void context(const std::vector<std::string>& args);

    void prompt();

private:
    bool quit_;
    interface& intf_;
    gtd::gtd& backend_;
    std::string context_;
    boost::optional<gtd::gtd::project_id> pid_;
};

#endif // _APPLICATION_HPP_
